package Arrays;

import java.util.Arrays;

public class arrays {
    public static void main(String[] args) {
        int[] arr = new int[]{1, 5, 6, 4, 2, 3};
        String string = Arrays.toString(arr);
        System.out.println(string);
        int binarySearch = Arrays.binarySearch(arr, 5);
        System.out.println(binarySearch);
        int[] copy = Arrays.copyOf(arr, arr.length);
        int[] copy1 = Arrays.copyOfRange(arr, arr.length / 2 - 1, arr.length - 1);
        System.out.println(Arrays.toString(copy));
        System.out.println(Arrays.toString(copy1));
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
    }
}
